<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>登录</title>
    <include file="Common:header_include"/>
</head>
<body>
<!--顶部开始-->
<include file="Common:header"/>
<!--顶部结束-->
<!--主体内容开始-->
<div class="zc_main">
    <div class="lt">
        <img src="__HIMG__003.jpg" alt=""/>
    </div>
    <div class="rt">
        <form  class="form form-horizontal va-m Validform" id="demoform-1">
            <div class="form-group">
                <label class="form-label col-xs-4 col-sm-3">用户名</label>
                <div class="formControls col-xs-7 col-sm-8">
                    <input type="text" class="form-control"  name="phone" placeholder="请输入手机号码" value="">
                </div>
            </div>
            <div class="form-group">
                <label class="form-label col-xs-4 col-sm-3">密码：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="password" class="form-control" autocomplete="off" name="passwd" placeholder="请输入密码">
                </div>
            </div>
            <div class="form-group">
                <label class="form-label  col-xs-4">验证码：</label>
                <div class="col-xs-4">
                    <input type="text" name="code" class="form-control" autocomplete="off" placeholder="请输入验证码">
                </div>
                <div class="col-xs-4">
                    <img src="{:U('verify')}" class="verify"  id="verify" onclick="changeYzm(this)" style="margin-left: -15px;margin-top: -5px">
                </div>
            </div>
            <div class="row">
                <label class="form-label col-xs-4 col-sm-3"></label>
                <div class="formControls skin-minimal col-xs-8 col-sm-9">
                    <div class="checkbox">
                        <label><input type="checkbox">记住密码</label>
                        <a href="{:U('pwd')}" style=" text-decoration: none;">忘记密码？</a>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <input class="btn btn-default" type="button" onclick="logins()" value="登录">
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3 tishi">
                    没有账号？<a href="{:U(register)}" style=" text-decoration: none;">免费注册</a>
                </div>
            </div>
        </form>
    </div>
</div>
<!--主体内容结束-->
<!--尾部开始-->
<include file="Common:footer"/>
<!--尾部结束-->
</body>
<script>

    function logins() {
        $.ajax({
            url:"{:U('DoctorInfo/login')}",
            data:$("#demoform-1").serialize(),
            type:"Post",
            dataType:"json",
            success:function (data) {
                if(data.status==1){
                    layer.msg(data.msg,{icon:6,time: 1000},function(){
                        window.location.href="{:U('DoctorInfo/index',array('genre'=>1))}";
                    });
                }else{
                    layer.msg(data.msg,{time: 1000},function () {
                       $('#verify').src="{:U('verify')}";
                    });
                }
            },
            error:function (err) {
                layer.msg('登陆失败，请刷新页面尝试再一次登录');
            }
        })
    }
    function changeYzm(obj){
        var rand = parseInt(Math.random()*5);
        //  var url = "<?php echo U('verify');?>"+"?rand="+rand;
        var url="{:U('verify')}"+"?rand="+rand;
        obj.src = url;
    }
</script>
</html>